<template>
  <div>
    <el-card class="cardBox">
      <div class="title">
        <h1 class="">5-2二部皮带参数</h1>
        <el-button @click="alarmBtn">报警总数：0</el-button>
      </div>

      <!-- 参数表格 -->
      <div style="border: 1px solid var(--el-border-color-light)">
        <el-row class="header-row">
          <el-col :span="8"></el-col>
          <el-col :span="8" class="title-col"
            ><span>5-2二部皮带参数</span></el-col
          >
          <el-col :span="8" class="status-col">
            <div class="status-container">
              <div>
                <span>通讯故障</span>
                <i class="yuan yellow"></i>
              </div>
              <div>
                <span>无故障</span>
                <i class="yuan grey"></i>
              </div>
              <div>
                <span>运行</span>
                <i class="yuan green"></i>
              </div>
              <div>
                <span>报警</span>
                <i class="yuan red"></i>
              </div>
            </div>
          </el-col>
        </el-row>
        <el-row class="threeTitle">
          <el-col :span="3">项目</el-col>
          <el-col :span="2">1</el-col>
          <el-col :span="2">2</el-col>
          <el-col :span="2">3</el-col>
          <el-col :span="4">项目</el-col>
          <el-col :span="1">状态值</el-col>
          <el-col :span="4">项目</el-col>
          <el-col :span="1">状态值</el-col>
          <el-col :span="4">项目</el-col>
          <el-col :span="1">状态值</el-col>
        </el-row>
        <el-row>
          <el-col :span="3">输出电流（A）</el-col>
          <el-col :span="2">
            {{ NamePD_52_2("OutputCurrent1_AI", operator.NO, null, 2) }}</el-col
          >
          <el-col :span="2">
            {{ NamePD_52_2("OutputCurrent2_AI", operator.NO, null, 2) }}</el-col
          >
          <el-col :span="2">
            {{ NamePD_52_2("OutputCurrent3_AI", operator.NO, null, 2) }}</el-col
          >
          <el-col :span="4">华宁保护正常</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('HNProtNormal_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">1#变频器故障</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('VFD1FaultFeed_DI', operator.NO).value < 1
                  ? 'red'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">冷却风机回馈故障</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('CoolFanFeedFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div
          ></el-col>
        </el-row>
        <el-row>
          <el-col :span="3">输出转速</el-col>
          <el-col :span="2">
            {{ NamePD_52_2("OutputSpeed1_AI", operator.NO, null, 2) }}</el-col
          >
          <el-col :span="2">
            {{ NamePD_52_2("OutputSpeed2_AI", operator.NO, null, 2) }}</el-col
          >
          <el-col :span="2">
            {{ NamePD_52_2("OutputSpeed3_AI", operator.NO, null, 2) }}</el-col
          >
          <el-col :span="4">华宁保护备妥</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('HNProtReady_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">2#变频器故障</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('VFD2FaultFeed_DI', operator.NO).value < 1
                  ? 'red'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">抱闸未到位故障</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('BrakeNotInPlaceFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div
          ></el-col>
        </el-row>
        <el-row>
          <el-col :span="3">电机绕组温度（℃）</el-col>
          <el-col :span="2">
            {{
              NamePD_52_2("Mot1WindingTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="2">
            {{
              NamePD_52_2("Mot2WindingTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="2">
            {{
              NamePD_52_2("Mot3WindingTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="4">集控准备就绪</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('RemoteReady_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">3#变频器故障</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('VFD3FaultFeed_DI', operator.NO).value < 1
                  ? 'red'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">松闸未到位故障</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('BrakeNotReleasedFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div
          ></el-col>
        </el-row>
        <el-row>
          <el-col :span="3">电机前轴温度（℃）</el-col>
          <el-col :span="2">
            {{
              NamePD_52_2("Mot1FrontShaftTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="2">
            {{
              NamePD_52_2("Mot2FrontShaftTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="2">
            {{
              NamePD_52_2("Mot3FrontShaftTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="4">盘闸松闸到位信号</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('DiscBrakeReleased_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">外部输入故障</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('ExternalInputFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">变频回馈故障</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('InverterFeedFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div
          ></el-col>
        </el-row>
        <el-row>
          <el-col :span="3">电机后轴温度（℃）</el-col>
          <el-col :span="2">
            {{
              NamePD_52_2("Mot1RearShaftTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="2">
            {{
              NamePD_52_2("Mot2RearShaftTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="2">
            {{
              NamePD_52_2("Mot3RearShaftTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="4">低速</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('LowSpeed_DI', operator.NO).value ? 'green' : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">起动流程故障</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('StartProcessFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">变频停止无反应</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('InverterStopNoResp_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div
          ></el-col>
        </el-row>
        <el-row>
          <el-col :span="3">电机冷却出口温度（℃）</el-col>
          <el-col :span="2">
            {{
              NamePD_52_2("Mot1CoolantOutletTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="2">
            {{
              NamePD_52_2("Mot2CoolantOutletTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="2">
            {{
              NamePD_52_2("Mot3CoolantOutletTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="4">中速</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('MediumSpeed_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">华宁回馈故障</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('HNFeedFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">五羊张紧故障回馈</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('WuyangTensionFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div
          ></el-col>
        </el-row>
        <el-row>
          <el-col :span="3">电机冷却进口温度（℃）</el-col>
          <el-col :span="2">
            {{
              NamePD_52_2("Mot1CoolantInletTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="2">
            {{
              NamePD_52_2("Mot2CoolantInletTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="2">
            {{
              NamePD_52_2("Mot3CoolantInletTemp_AI", operator.NO, null, 2)
            }}</el-col
          >
          <el-col :span="4">高速</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('HighSpeed_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">张紧未到位故障</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('TensionNotInPlaceFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">盘闸故障信号</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('DiscBrakeFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div
          ></el-col>
        </el-row>
        <el-row>
          <el-col :span="3">滚筒温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_52_2("Roller1Temp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_52_2("Roller2Temp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2"></el-col>
          <el-col :span="4">1#变频为主机</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('VFD1HostStatus_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">1#变频运行</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('VFD1RunFeed_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">1#冷却风机回馈</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('CoolFan1Feed_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
        </el-row>
        <el-row>
          <el-col :span="3"></el-col>
          <el-col :span="2"> </el-col>
          <el-col :span="2"></el-col>
          <el-col :span="2"></el-col>
          <el-col :span="4">2#变频为主机</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('VFD2HostStatus_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">2#变频运行</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('VFD1RunFeed_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">2#冷却风机回馈</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('CoolFan2Feed_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
        </el-row>
        <el-row>
          <el-col :span="3"></el-col>
          <el-col :span="2"></el-col>
          <el-col :span="2"></el-col>
          <el-col :span="2"></el-col>
          <el-col :span="4">3#变频为主机</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('VFD3HostStatus_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">3#变频运行</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('VFD1RunFeed_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
          <el-col :span="4">3#冷却风机回馈</el-col>
          <el-col :span="1"
            ><div
              class="indicator-light"
              :class="
                NamePD_52_2('CoolFan3Feed_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div
          ></el-col>
        </el-row>
        <el-row>
          <el-col :span="3" class="huaning-title">华宁保护</el-col>
          <el-col :span="21">
            <div class="hn-container">
              <span
                >跑偏保护<span class="hn-span"
                  ><div
                    class="indicator-light"
                    :class="
                      NamePD_52_2('HNProtDeviation1_DI', operator.NO).value ||
                      NamePD_52_2('HNProtDeviation2_DI', operator.NO).value
                        ? 'red'
                        : 'grey'
                    "
                  ></div></span
              ></span>
              <span
                >堆煤保护<span class="hn-span"
                  ><div
                    class="indicator-light"
                    :class="
                      NamePD_52_2('HNProtCoalPile_DI', operator.NO).value
                        ? 'red'
                        : 'grey'
                    "
                  ></div></span
              ></span>
              <span
                >烟雾保护<span class="hn-span"
                  ><div
                    class="indicator-light"
                    :class="
                      NamePD_52_2('HNProtSmoke_DI', operator.NO).value
                        ? 'red'
                        : 'grey'
                    "
                  ></div></span
              ></span>
              <span
                >速度保护<span class="hn-span"
                  ><div
                    class="indicator-light"
                    :class="
                      NamePD_52_2_GEN(
                        'BeltSpeed_AI',
                        operator.Multiply,
                        1000,
                        2
                      ).value > 65534
                        ? 'red'
                        : 'grey'
                    "
                  ></div></span
              ></span>
              <span
                >纵撕保护<span class="hn-span"
                  ><div
                    class="indicator-light"
                    :class="
                      NamePD_52_2('HNProtLongTear_DI', operator.NO).value
                        ? 'red'
                        : 'grey'
                    "
                  ></div></span
              ></span>
              <span
                >温度保护<span class="hn-span"
                  ><div
                    class="indicator-light"
                    :class="
                      NamePD_52_2('Roller1Temp_AI', operator.NO).value ||
                      NamePD_52_2('Roller2Temp_AI', operator.NO).value
                        ? 'red'
                        : 'grey'
                    "
                  ></div></span
              ></span>

              <span style="color: orange">
                终端电压（V）：
                <span>
                  {{ NamePD_52_2("HNProtTermVolt_AI", operator.Divide, 10, 2) }}
                </span>
              </span>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="3" class="huaning-title">华宁沿线闭锁</el-col>
          <el-col :span="21">
            <div class="index-container">
              <div
                class="index-circle"
                v-for="(item, index) in HUANINGBH"
                :key="index"
                :class="NamePD_52_2(item, operator.NO).value ? 'red' : 'grey'"
              >
                {{ index + 1 }}
              </div>
            </div>
          </el-col>
        </el-row>
      </div>

      <div style="display: flex; justify-content: end; margin-top: 20px">
        <el-button @click="faultResetBtn">故障复位</el-button>
        <el-button @click="sensorBtn">4-2皮带传感器参数</el-button>
        <el-button @click="switchBtn_1">一号组合开关</el-button>
        <el-button @click="switchBtn_2">二号组合开关</el-button>
      </div>

      <div style="margin-top: 50px">
        <span>摄像头</span>
        <span
          >皮带速度
          {{ NamePD_52_2_GEN("BeltSpeed_AI", operator.NO, null, 2) }}
          m/s</span
        >
      </div>

      <div style="">
        <img
          src="@/assets/images/belt1.png"
          style="width: 100%; height: 250px"
        />
      </div>
    </el-card>

    <!-- 公司log -->
    <el-row>
      <div class="kx-log-box">
        <img
          class="kx-img"
          src="@/assets/images/kxauto.png"
          alt="描述图片的文字"
        />
        <span>开轩自动化</span>

        <span class="kx-hezuo">
          商务合作：18509234888（同微信） 技术支持：18691805301（同微信）
        </span>
      </div>
    </el-row>

    
    <!-- 弹窗 -->
    <form-dialog ref="formRef" />
    <sensorFormDialog ref="sensorRef" />
    <CoalCutterHeadSwitch_1 ref="coalCutterHeadSwitchRef1" />
    <CoalCutterHeadSwitch_2 ref="coalCutterHeadSwitchRef2" />
  </div>
</template>

<script setup lang="ts">
import { ref, reactive, onMounted, computed } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
// 引入子组件
import formDialog from "./alarmForm.vue";
import sensorFormDialog from "./sensorForm.vue";
import CoalCutterHeadSwitch_1 from "./coalCutterHeadSwitch_1.vue";
import CoalCutterHeadSwitch_2 from "./coalCutterHeadSwitch_2.vue";
import { act, createWebSocket } from "@/utils/websocket"; //引入websocket

import { operator } from "@/utils/op_enums";
import { NamePD_52_2, NamePD_52_2_GEN } from "@/utils/beltPositioningMethod.ts";

const HUANINGBH = [
  "HNLineLock1_DI",
  "HNLineLock2_DI",
  "HNLineLock3_DI",
  "HNLineLock4_DI",
  "HNLineLock5_DI",
  "HNLineLock6_DI",
  "HNLineLock7_DI",
  "HNLineLock8_DI",
  "HNLineLock9_DI",
  "HNLineLock10_DI",
  "HNLineLock11_DI",
  "HNLineLock12_DI",
  "HNLineLock13_DI",
  "HNLineLock14_DI",
  "HNLineLock15_DI",
  "HNLineLock16_DI",
  "HNLineLock17_DI",
  "HNLineLock18_DI",
  "HNLineLock19_DI",
];
const formRef = ref();
const sensorRef = ref();
const coalCutterHeadSwitchRef1 = ref();
const coalCutterHeadSwitchRef2 = ref();
const alarmBtn = () => {
  formRef.value.openDialog();
};
const sensorBtn = () => {
  sensorRef.value.openDialog();
};
const switchBtn_1 = () => {
  coalCutterHeadSwitchRef1.value.openDialog();
};
const switchBtn_2 = () => {
  coalCutterHeadSwitchRef2.value.openDialog();
};
const faultResetBtn = () => {
  ElMessage.info("故障复位");
};

// const NamePD_52_2 = (
//   key: string,
//   op: operator,
//   op_number?: number,
//   retain?: number
// ) =>
//   computed(() => {
//     return useTagResults(act.PD_52_2.PD_52_2[key], op, op_number, retain);
//   });

// const NamePD_52_2_GEN = (
//   key: string,
//   op: operator,
//   op_number?: number,
//   retain?: number
// ) =>
//   computed(() => {
//     return useTagResults(act.PD_52_2.PD_52_2_GEN[key], op, op_number, retain);
//   });
</script>

<style lang="scss" scoped>
.cardBox {
  background-color: var(--el-bg-color);
  border-radius: 8px;
  box-shadow: var(--el-box-shadow-light);
  border: 1px solid var(--el-border-color-light);

  /* 左上方标题 */
  .title {
    border-bottom: 1px solid var(--el-border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    h1 {
      color: var(--el-text-color-primary);
      font-size: 20px;
      margin: 0;
      font-weight: 500;
    }

    .el-button {
      background-color: var(--el-color-danger);
      color: var(--el-color-white);
      border: none;
      border-radius: 4px;
      padding: 8px 15px;
      font-weight: 500;

      &:hover {
        background-color: var(--el-color-danger-light-3);
      }
    }
  }

  /* 表格标题 + 四个指示灯 */
  .header-row {
    display: flex;
    align-items: center;
    background-color: var(--el-fill-color-lighter);
    font-weight: 500;
    color: var(--el-text-color-primary);
    padding: 10px;
    .el-col {
      height: 40px;
      display: flex;
      align-items: center;
      border: 1px solid transparent;
    }

    .title-col {
      justify-content: center;

      span {
        font-size: 18px;
      }
    }

    .status-col {
      justify-content: end;
      .status-container {
        display: flex;
        gap: 14px;

        div {
          background: var(--el-fill-color-blank);
          border: 1px solid var(--el-border-color-lighter);
          border-radius: 4px;
          padding: 4px 8px;
          display: flex;
          align-items: center;
          gap: 6px;
          font-size: 13px;

          span {
            padding: 0 4px;
          }

          .yuan {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            flex-shrink: 0;
            @extend %status-colors;
          }
        }
      }
    }
  }

  /* 表格的标题 项目 + 状态值 */
  .threeTitle {
    .el-col {
      background-color: var(--el-fill-color) !important;
    }
  }

  /* 每一小格子的边框 背景色 */
  .el-col {
    border: 1px solid var(--el-border-color-lighter);
    text-align: center;
    padding: 6px 5px;
    font-size: 13px;
    color: var(--el-text-color-regular);

    &:first-child,
    &:nth-child(5),
    &:nth-child(7),
    &:nth-child(9) {
      font-weight: 500;
      // color: blue;
      color: var(--el-text-color-primary);
      background-color: var(--el-fill-color-lighter);
    }
  }

  /* 子页面设备参数--指示灯 */
  .indicator-light {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--el-border-color);
    margin: 0 auto;
    @extend %status-colors;
  }

  /* 华宁沿线闭锁 */
  .huaning-title {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--el-text-color-primary);
    font-weight: 500;
  }

  .hn-container {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    padding: 8px;
    align-items: center;
    background-color: var(--el-fill-color-lighter);
    border-radius: 4px;

    span {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .hn-span {
      display: inline-flex;
      align-items: center;
    }
  }

  .index-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    justify-content: flex-start;
    background-color: var(--el-fill-color-lighter);
    border-radius: 4px;
    min-height: 40px;
    align-items: center;
  }

  .index-circle {
    width: 26px;
    height: 26px;
    background-color: var(--el-border-color);
    border-radius: 50%;
    color: var(--el-text-color-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    @extend %status-colors;
  }

  // 定义基础颜色类（只定义一次）
  %status-colors {
    &.green {
      background-color: var(--el-color-success);
    }
    &.red {
      background-color: var(--el-color-danger);
    }
    &.yellow {
      background-color: var(--el-color-warning);
    }
    &.grey {
      background-color: var(--el-border-color-dark); // 比默认边框色更深的灰色
    }
  }
}
</style>
